
// 初始化minioClient
// import Minio from 'minio'
const Minio = require('minio')
export function initMinio() {
  return new Promise((resolve, reject) => {
    const minioObj = {
      endPoint: process.env.VUE_APP_MINIO_ENDPOINT,
      port: process.env.VUE_APP_MINIO_PORT,
      // useSSL: process.env.VUE_APP_MINIO_USESSL,
      useSSL: false,
      accessKey: process.env.VUE_APP_MINIO_ACCESS,
      secretKey: process.env.VUE_APP_MINIO_SECRET
    }
    var minioClient = newMinio(minioObj)
    resolve(minioClient)
  })
}

export const newMinio = (minioObj) => {
  return new Minio.Client(minioObj)
}

